*Black, Owens, Wedeking & Wohlfarth
*Chapter 7 Replication


use "Ch-7_Data.dta"

*Table 7.1

*Model 1
logit author consciPI openPI extraPI agreePI neuroPI, robust cl(led)

*Model 2
logit author consciPI openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)

*Model 3
logit author consciPI openPI extraPI agreePI neuroPI legalimp c.consciPI#i.legalimp, robust cl(led)

*Model 4
logit author c.consciPI##i.legalimp openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)

*Model 5
logit author consciPI openPI extraPI agreePI neuroPI zamici c.consciPI#c.zamici, robust cl(led)

*Model 6
logit author c.consciPI##c.zamici openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)

*Model 7
logit author consciPI openPI extraPI agreePI neuroPI xmargin c.consciPI#c.xmargin, robust cl(led)

*Model 8
logit author c.consciPI##c.xmargin openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)

*Model 9
logit author consciPI openPI extraPI agreePI neuroPI xdays c.consciPI#c.xdays, robust cl(led)

*Model 10
logit author c.consciPI##c.xdays openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)


*Figure 7.5(a)
logit author c.consciPI##i.legalimp openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)
quietly margins, at(consciPI=(-3.7(.1)1.2) legalimp=(0 1)) 
marginsplot, xlabel(-3.7(.4)1.2) ylabel(.05(.05).2) plotopt(msymbol(none)) recastci(rarea) noci xtitle(Supreme Court Justice Conscientiousness) ytitle(Predicted Probability of Opinion Assignment) title("") scheme(s1mono) legend(order(1 "Non-Legally Salient" 2 "Legally Salient"))

*Figure 7.5(b)
quietly margins, dydx(legalimp) at(consciPI=(-3.7(.1)1.2)) 
marginsplot, xlabel(-3.7(.4)1.2) plotopt(msymbol(none)) ciopts(color(gs10)) recastci(rarea) ylin(0) level(90) xtitle(Supreme Court Justice Conscientiousness) ytitle(Average Marginal Effect of Legal Salience) title("") scheme(s1mono)

*Figure 7.5(c)
quietly margins, dydx(consciPI) at(legalimp=(0 1)) vsquish
marginsplot, recast(scatter) xlabel(0 1) plotopt(mcolor(black) msymbol(circle)) ciopts(lcolor(black) msize(small)) ylin(0) level(90) xtitle(Legally Salient Case) ytitle(Average Marginal Effect of Conscientiousness) title("") scheme(s1mono) legend(off)  

*Figure 7.6(b)
logit author c.consciPI##c.zamici openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)
quietly margins, dydx(zamici) at(consciPI=(-3.7(.1)1.2))
marginsplot, xlabel(-3.7(.4)1.2) plotopt(msymbol(none)) ciopts(color(gs10)) recastci(rarea) ylin(0) level(90) xtitle(Supreme Court Justice Conscientiousness) ytitle(Average Marginal Effect of Political Salience) title("") scheme(s1mono)

*Figure 7.6(c)
logit author c.consciPI##c.xmargin openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)
quietly margins, dydx(xmargin) at(consciPI=(-3.7(.1)1.2))
marginsplot, xlabel(-3.7(.4)1.2) plotopt(msymbol(none)) ciopts(color(gs10)) recastci(rarea) ylin(0) level(90) xtitle(Supreme Court Justice Conscientiousness) ytitle(Average Marginal Effect of Winning Margin) title("") scheme(s1mono)

*Figure 7.6(d)
logit author c.consciPI##c.xdays openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)
quietly margins, dydx(xdays) at(consciPI=(-3.7(.1)1.2))
marginsplot, xlabel(-3.7(.4)1.2) plotopt(msymbol(none)) ciopts(color(gs10)) recastci(rarea) ylin(0) level(90) xtitle(Supreme Court Justice Conscientiousness) ytitle(Average Marginal Effect of End of Term) title("") scheme(s1mono)

*Figure 7.7(a)
logit author c.consciPI##c.xmargin openPI extraPI agreePI neuroPI ideodist cj saj newexpmx effnatct, robust cl(led)
quietly margins, dydx(consciPI) at(xmargin=(-3(1)2))
marginsplot, xlabel(-3(1)2) plotopt(msymbol(none)) ciopts(color(gs10)) recastci(rarea) ylin(0) level(90) xtitle(Winning Margin) ytitle(Average Marginal Effect of Conscientiousness) title("") scheme(s1mono)

*Figure 7.7(b)
quietly margins, at(consciPI=(-3.7(.1)1.2) xmargin=(-2 2))
marginsplot, xlabel(-3.7(.4)1.2) plotopt(msymbol(none)) noci level(90) xtitle(Supreme Court Justice Conscientiousness) ytitle(Predicted Probability of Opinion Assignment) title("") scheme(s1mono) legend(order(1 "Low Margin" 2 "High Margin"))

